package com.yunhe.common.constant;

/**
 * 告警常量定义
 */
public class AbnormalConsts {
    //异常处理状态常量
    public enum ABNORMAL_STATUS {
        READY("待处理", "Ready"), SENT("已派单", "Sent"), ELIMINATED("已消除","Eliminated");

        private String title;
        private String name;

        ABNORMAL_STATUS(String title, String name) {
            this.title = title;
            this.name = name;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum ALARM_LEVEL {
        NORMAL("Normal", 0, "正常"),
        IGNORE("Ignore", 1, "忽略"),
        SLIGHT("Slight", 2, "通知"),
        Moderate("Moderate", 3, "预警"),
        SERIOUS("Serious", 4, "故障");
        private Integer code;
        private String title;
        private String value;
        ALARM_LEVEL(String value, Integer code, String title) {
            this.code = code;
            this.value = value;
            this.title = title;
        }
        public Integer code() {
            return code;
        }
        public String title() {
            return title;
        }
        public String value() {
            return value;
        }
        public static ALARM_LEVEL byValue(String value) {
            ALARM_LEVEL[] values = ALARM_LEVEL.values();
            for (ALARM_LEVEL item : values) {
                if (item.equals(value)) {
                    return item;
                }
            }
            return null;
        }
        public boolean equals(String value) {
            return this.value().equals(value);
        }
    }

    public enum ALARM_POINTDATATYPE {
        VIRTUALALARM("告警点号数据类型", "VirtualAlarm");
        private String title;
        private String name;

        ALARM_POINTDATATYPE(String title, String name) {
            this.title = title;
            this.name = name;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public enum ALARM_RULE_TITLE {
        HEARTBEAT_EN("Offline","离线英文"),
        HEARTBEAT_CN("通讯中断","离线中文");

        private String value;
        private String title;

        ALARM_RULE_TITLE(String value, String title) {
            this.value = value;
            this.title = title;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }
    }
}
